﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="website_admin_knowlegebase_kbcategoryinfoeditor"
    CodeBehind="kbcategoryinfoeditor.aspx.cs" %>

<%@ Register Src="../../admin/_root/_controls/ctlNavBar.ascx" TagName="ctlNavBar"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script src="../_common/scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

    <script language="javascript" src="../_static/_jQuery/jquery-fileupload.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../admin/_static/_jQuery/jquery_validator.js"></script>

    <script type="text/javascript" language="javascript" src="../_common/scripts/util.js"></script>

    <link href="../_common/styles/form_v2_0.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">
        $(document).ready(setup);
        function setup() {
            validator.setup("#crmForm");
            uploadcreate($("#divUploadControlArea_CategoryImage"), "CategoryImage");
        }
        //删除方法    
        var uploadinit = function(obj){
            if(confirm("You sure you want to delete this category?"))
            {
               currentItemID ++;
               $.ajax({
                    async: false,
                    type: "POST",
                    url: prependOrgName("/website_admin/fileupload.aspx"),
                    data: {
                        otype : "removefile", 
                        filename: obj.attr("filedata").split("*")[1], 
                        itemid: obj.attr("itemid"), 
                        extname: obj.attr("filedata").split("*")[2]
                    },
                    success: function(data, textStatus) {
                        obj.parent().remove(); 
                        $("#txtUploadControl_"+obj.attr("itemid")).removefile(obj.attr("filedata"));
                    }
                });
            }
        };
        function Cancel() {
            window.close();
        }
    </script>

</head>
<body scrool="no" style="margin: 0px; padding: 0px; background: #F0F0F0;">

    <script type="text/javascript">
    <!--
        function __doPostBack(eventTarget) {
            var theForm = document.forms["form1"];
            if (!theForm) {
                theForm = document.crmForm;
            }
            if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
                theForm.__EVENTTARGET.value = eventTarget;
                theForm.submit();
            }
        }
    // -->
    </script>

    <div id="success" style="position: absolute; z-index: 300; height: 130px; width: 284px;
        left: 50%; top: 50%; margin-left: -150px; margin-top: -80px;">
        <div style="position: absolute; z-index: 300; width: 270px; height: 90px; background-color: #FFFFFF;
            border: solid #6699CC 1px; font-size: 14px;">
            <div style="height: 64px; line-height: 150%; padding: 0px 3px 0px 3px;" align="center">
                <br />
                <table>
                    <tr>
                        <td valign="top">
                            <img border="0" src="../_imgs/admin/progress.gif" />
                        </td>
                        <td valign="middle" style="font-size: 14px; width: 150px;">
                            Loading ...<br />
                        </td>
                    </tr>
                </table>
                <br />
            </div>
        </div>
        <div style="position: absolute; width: 270px; height: 108px; z-index: 299; left: 4px;
            top: 5px; background-color: #E8E8E8; border: #E8E8E8 1px solid; display: none;">
        </div>
    </div>

    <script type="text/javascript">
        document.getElementById("success").style.display = "none"; 
    </script>

    <script src="../../admin/_static/_common/scripts/divcover.js" type="text/javascript"></script>

    <form id="crmForm" runat="server">
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    <table cellpadding="0" cellspacing="0" class="WIN-Form-Layout">
        <tr style="height: 32px;">
            <td colspan="1" class="WIN-Form-Title-Bar">
                <span>产品类别编辑</span>
            </td>
        </tr>
        <tr style="height: 100%; background: #ffffff;">
            <td valign="top" style="padding: 10px 10px 10px 0px;">
                <div class="content">
                    <div class="checkoutBox noBorder" id="errorMsg" runat="server" style="background: #FFFDCF;
                        width: 762px; line-height: 21px; padding: 10px;" visible="false">
                    </div>
                    <div class="checkoutBox noBorder">
                        <div class="tabContainer">
                            <ul class="tabHead">
                                <li class="currentBtn"><a id="a21" href="javascript:void(0);" title="General" rel="21">
                                    常规</a></li>
                            </ul>
                        </div>
                        <div class="clear">
                        </div>
                        <ul class="infoList edit" id="tab_21">
                            <li style="width: 100%; height: auto;">
                                <table cellpadding="5" cellspacing="5" style="border: 0px; table-layout: fixed; width: 650px; font-size: 12px; margin-left: 20px;">
                                    <colgroup>
                                        <col style="width: 115px; text-align: right;" />
                                        <col />
                                        <col style="width: 115px; text-align: right;" />
                                        <col />
                                    </colgroup>
                                    <tbody>
                                        <tr>
                                            <td>
                                                名称：
                                            </td>
                                            <td colspan="3">
                                                <input type="text" class="tbxReadOnly" id="txtCategoryName" name="txtCategoryName"
                                                    runat="server" required="required" controlname="名称" isvalidator />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                上级类别：
                                            </td>
                                            <td colspan="3">
                                                <select id="selParentList" runat="server" class="SelectBox">
                                                    <option value="00000000-0000-0000-0000-000000000000">-- 作为顶级类别 --</option>
                                                </select>
                                                <input type="hidden" id="txtOriginalParentId" name="txtOriginalParentId" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                排序：
                                            </td>
                                            <td>
                                                <input type="text" class="tbxReadOnly" id="txtLineNum" name="txtLineNum" value="0"
                                                    runat="server" required="required" controlname="Sort" isvalidator datatype="integer" />
                                            </td>
                                            <td style="text-align: right;">
                                                <label for="cbxIsProtected">
                                                系统保护类别：</label>
                                            </td>
                                            <td>
                                                <label for="cbxIsProtected">
                                                    <input type="checkbox" id="cbxIsProtected" name="cbxIsProtected" runat="server" />是</label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                类型：
                                            </td>
                                            <td colspan="3">
                                                <select id="selTypeList" name="selTypeList" runat="server" class="SelectBox">
                                                    <option value="1">列表</option>
                                                    <option value="2">内容</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                图片：
                                            </td>
                                            <td colspan="2">
                                                <input id="txtUploadControl_CategoryImage" runat="server" type="hidden" />
                                                <div id="divUploadControlArea_CategoryImage" runat="server">
                                                </div>
                                                <div id="divProductImagesList_CategoryImage" runat="server">
                                                </div>
                                            </td>
                                            <td>
                                                <span style="color: Red;">尺寸: 164 × 115px;</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                链接：
                                            </td>
                                            <td colspan="3">
                                                <input type="text" class="tbxReadOnly" id="txtObjectLoweredName" name="txtObjectLoweredName" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                键值：
                                            </td>
                                            <td colspan="3">
                                                <input type="text" class="tbxReadOnly" id="txtCategoryNumber" name="txtCategoryNumber" readonly runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                备注信息：
                                            </td>
                                            <td colspan="3">
                                                <textarea rows="3" type="text" class="tbxReadOnly" id="txtDescription" name="txtDescription"
                                                    runat="server"></textarea>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </li>
                        </ul>
                        <div class="clear">
                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr style="height: 45px;">
            <td class="WIN-Form-Bottom">
                <input type="button" value="保存" id="Button1" class="btn_s" onclick="if(validator.validatorAll()){this.disabled=true;success.style.display = 'block';HideOverSels('success');__doPostBack('save');}"
                    style="width: 120px; height: 25px; margin: 0px 5px;" />
                <input type="button" value="关闭" id="Button2" class="btn_s" onclick="Cancel();" style="height: 25px;
                    width: 120px; margin: 0px 5px;" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
